package br.mg.bhe.ftpobre.fs.data.xml;

import java.io.File;
import java.io.IOException;

import javax.swing.table.TableModel;

import br.mg.bhe.ftpobre.ConnectionData;

/**
 * 
 * @author Aureliano
 */
public final class XmlFacade {

	private XmlFacade() {
		super();
	}
	
	public static void writeTableModelToXml(
			TableModel data, File outcome) throws IOException {
		
            XmlWriter.write(new TableModelParser(), data, outcome);
	}
	
	public static void writeConnectionDataToXml(
			ConnectionData data, File outcome) throws IOException {
		
            XmlWriter.write(new ConnectionDataParser(), data, outcome);
	}
	
	public static ConnectionData readConnectionDataXml(File income) throws Exception {
            return (ConnectionData) XmlReader.read(new ConnectionDataParser(), income);
	}

        public static TableModel readTableModel(File income) throws Exception {
            return (TableModel) XmlReader.read(new TableModelParser(), income);
        }
}